package Cn.Sarkar.MMS.Entities.Independent.Permission

import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.Entities.Common.Additional.IDescription
import Cn.Sarkar.MMS.DataBaseDefinations.Independent.Permission.PermissionItems
import Cn.Sarkar.Entities.Common.Additional.IName
import Cn.Sarkar.MMS.Entities.Additional.Description
import Cn.Sarkar.MMS.Entities.Additional.Name
import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.Entities.MMS.Independent.Permission.IPermissionItem

class PermissionItem(DataContext: IDataContext) : BaseEntity(DataContext, PermissionItems), IPermissionItem {
    var nameID by PermissionItems.NameID
    override var name: IName by hasOne(PermissionItems.NameID) { Name(it) }
    override var code by PermissionItems.Code
    var descriptionID by PermissionItems.DescriptionID
    override var description: IDescription by hasOne(PermissionItems.DescriptionID) { Description(it) }
    override var additional: Int by PermissionItems.Additional
}